package com.github.catvod.spider.merge;

import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

public class jP {
  private static final char[] h = "0123456789ABCDEF".toCharArray();
  
  public static String BQ(String paramString1, String paramString2, String paramString3) {
    try {
      byte[] arrayOfByte = aF.h(paramString1);
      SecretKeySpec secretKeySpec = new SecretKeySpec();
      this(paramString2.getBytes(), "AES");
      IvParameterSpec ivParameterSpec = new IvParameterSpec();
      this(paramString3.getBytes());
      Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
      cipher.init(2, secretKeySpec, ivParameterSpec);
      return new String(cipher.doFinal(arrayOfByte), "UTF-8");
    } catch (Exception exception) {
      exception.printStackTrace();
      return null;
    } 
  }
  
  public static String I(String paramString1, String paramString2, String paramString3, String paramString4) {
    try {
      SecretKeySpec secretKeySpec = new SecretKeySpec();
      this(paramString3.getBytes("UTF-8"), "AES");
      Cipher cipher = Cipher.getInstance("AES/CTR/PKCS5Padding");
      IvParameterSpec ivParameterSpec = new IvParameterSpec();
      this(paramString4.getBytes());
      cipher.init(2, secretKeySpec, ivParameterSpec);
      return new String(cipher.doFinal(aF.h(paramString1)), paramString2);
    } catch (Exception exception) {
      return null;
    } 
  }
  
  public static String Qy(String paramString1, String paramString2, String paramString3) {
    SecretKeySpec secretKeySpec = new SecretKeySpec(oq(paramString2.getBytes()).getEncoded(), "AES");
    Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
    cipher.init(1, secretKeySpec, new IvParameterSpec(u(paramString3)));
    return aF.V0(cipher.doFinal(paramString1.getBytes("UTF-8"))).toString();
  }
  
  public static String V0(String paramString1, String paramString2) {
    if (paramString2 != null)
      try {
        if (paramString2.length() == 32) {
          SecretKeySpec secretKeySpec = new SecretKeySpec();
          this(paramString2.getBytes("UTF-8"), "AES");
          Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
          cipher.init(2, secretKeySpec);
          return new String(cipher.doFinal(aF.h(paramString1)), "UTF-8");
        } 
        IllegalArgumentException illegalArgumentException1 = new IllegalArgumentException();
        this("密钥长度必须为 32 字节");
        throw illegalArgumentException1;
      } catch (Exception exception) {
        exception.printStackTrace();
        return null;
      }  
    IllegalArgumentException illegalArgumentException = new IllegalArgumentException();
    this("密钥长度必须为 32 字节");
    throw illegalArgumentException;
  }
  
  public static String W(String paramString1, String paramString2, String paramString3) {
    SecretKeySpec secretKeySpec = new SecretKeySpec(oq(paramString2.getBytes()).getEncoded(), "AES");
    Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
    cipher.init(1, secretKeySpec, new IvParameterSpec(paramString3.getBytes()));
    return aF.V0(cipher.doFinal(paramString1.getBytes("UTF-8"))).toString();
  }
  
  public static String h(String paramString1, String paramString2) {
    if (paramString2 == null)
      try {
        System.out.print("Key为空null");
        return null;
      } catch (Exception exception) {
        System.out.println(exception.toString());
        return null;
      }  
    if (paramString2.length() != 16) {
      System.out.print("Key长度不是16位");
      return null;
    } 
    byte[] arrayOfByte2 = paramString2.getBytes("utf-8");
    SecretKeySpec secretKeySpec = new SecretKeySpec();
    this(arrayOfByte2, "AES");
    Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
    cipher.init(2, secretKeySpec);
    byte[] arrayOfByte1 = aF.h((String)exception);
    try {
      return new String(cipher.doFinal(arrayOfByte1), "utf-8");
    } catch (Exception exception1) {
      System.out.println(exception1.toString());
      return null;
    } 
  }
  
  public static String j(String paramString1, String paramString2) {
    SecretKeySpec secretKeySpec = new SecretKeySpec(paramString2.getBytes("utf-8"), "AES");
    Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
    cipher.init(1, secretKeySpec);
    return aF.V0(cipher.doFinal(paramString1.getBytes("utf-8")));
  }
  
  public static String oC(String paramString1, String paramString2, String paramString3) {
    try {
      IvParameterSpec ivParameterSpec = new IvParameterSpec();
      this(paramString3.getBytes("UTF-8"));
      SecretKeySpec secretKeySpec = new SecretKeySpec();
      this(paramString2.getBytes("UTF-8"), "AES");
      Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
      cipher.init(2, secretKeySpec, ivParameterSpec);
      return new String(cipher.doFinal(aF.h(paramString1)), "UTF-8");
    } catch (Exception exception) {
      exception.printStackTrace();
      return null;
    } 
  }
  
  private static Key oq(byte[] paramArrayOfbyte) {
    return new SecretKeySpec(paramArrayOfbyte, "AES");
  }
  
  public static String q(String paramString1, String paramString2, String paramString3) {
    SecretKeySpec secretKeySpec = new SecretKeySpec(oq(paramString2.getBytes()).getEncoded(), "AES");
    Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
    cipher.init(2, secretKeySpec, new IvParameterSpec(paramString3.getBytes()));
    return new String(cipher.doFinal(aF.h(paramString1)), "UTF-8");
  }
  
  public static byte[] u(String paramString) {
    if (paramString.length() < 1)
      return null; 
    byte[] arrayOfByte = new byte[paramString.length() / 2];
    for (byte b = 0; b < paramString.length() / 2; b++) {
      int j = b * 2;
      int i = j + 1;
      arrayOfByte[b] = (byte)(Integer.parseInt(paramString.substring(j, i), 16) * 16 + Integer.parseInt(paramString.substring(i, j + 2), 16));
    } 
    return arrayOfByte;
  }
}


/* Location:              /Users/hetaiyi/Desktop/my/tech/java/study/aa/temp/temp.jar!/com/github/catvod/spider/merge/jP.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */